#ifndef CLIENTSOCKET_H
#define CLIENTSOCKET_H

#include <QTcpSocket>
#include "network/tlpacket.h"

class ClientSocket : public QTcpSocket
{
    Q_OBJECT
public:
    explicit ClientSocket(QObject *parent = 0);
    void Send(Packets::TLPacket &packet);
    void Send(QByteArray data);
    void Send(char* data, quint32 size);
signals:
    void OnPacket(Packets::TLPacket &packet);

public slots:
     void OnData();
     void OnSend(quint64);
private:
     bool waitingdata;
     QByteArray wdata;
     void SendData(QByteArray data);
     Packets::TLPacket* dumper;
};

#endif // CLIENTSOCKET_H
